/**
 * 封装常用公共函数
 * @file: common.ts
 */

export const toggleLocalFullscreen = (element: HTMLElement) => {
    if (!document.fullscreenElement) {
        // 进入全屏
        element.requestFullscreen().catch(err => {
            console.error('全屏失败:', err);
        });
    } else {
        // 退出全屏
        if (document.exitFullscreen) {
            document.exitFullscreen();
        }
    }
};